#include <cstdint>
#include <type_traits>
#include <utility>

namespace rust {
inline namespace cxxbridge1 {
// #include "rust/cxx.h"

template <typename T>
union ManuallyDrop {
  T value;
  ManuallyDrop(T &&value) : value(::std::move(value)) {}
  ~ManuallyDrop() {}
};
} // namespace cxxbridge1
} // namespace rust

#if __cplusplus >= 201402L
#define CXX_DEFAULT_VALUE(value) = value
#else
#define CXX_DEFAULT_VALUE(value)
#endif

struct RustCommandParam;

#ifndef CXXBRIDGE1_STRUCT_RustCommandParam
#define CXXBRIDGE1_STRUCT_RustCommandParam
struct RustCommandParam final {
  ::std::int32_t command_id CXX_DEFAULT_VALUE(0);
  ::std::uint8_t const *input_data CXX_DEFAULT_VALUE(nullptr);
  ::std::uint32_t input_data_len CXX_DEFAULT_VALUE(0);
  ::std::uint8_t *output_data CXX_DEFAULT_VALUE(nullptr);
  ::std::uint32_t output_data_len CXX_DEFAULT_VALUE(0);
  ::std::uint8_t *common_output_data CXX_DEFAULT_VALUE(nullptr);
  ::std::uint32_t common_output_data_len CXX_DEFAULT_VALUE(0);

  using IsRelocatable = ::std::true_type;
};
#endif // CXXBRIDGE1_STRUCT_RustCommandParam

extern "C" {
::std::int32_t cxxbridge1$init_rust_env() noexcept;

::std::int32_t cxxbridge1$uninit_rust_env() noexcept;

::std::int32_t cxxbridge1$invoke_rust_command(::RustCommandParam *param) noexcept;
} // extern "C"

::std::int32_t init_rust_env() noexcept {
  return cxxbridge1$init_rust_env();
}

::std::int32_t uninit_rust_env() noexcept {
  return cxxbridge1$uninit_rust_env();
}

::std::int32_t invoke_rust_command(::RustCommandParam param) noexcept {
  ::rust::ManuallyDrop<::RustCommandParam> param$(::std::move(param));
  return cxxbridge1$invoke_rust_command(&param$.value);
}
